import { defineStore } from 'pinia';
import axios from 'axios';

export const useUserStore = defineStore('user', {
  state: () => ({
    userInfo: null as any, // 存储用户信息
  }),
  actions: {
    async fetchUserInfo(userId: string) {
      try {
        const response = await axios.get(`/health/user/v1/login`);
        this.userInfo = response.data;
      } catch (error) {
        console.error('Failed to fetch user info:', error);
      }
    },
  },
});